//-------------------------------------------------------------------
//	Copyright (c) 2012-2014 Zhirnov Andrey
//	This file is part of the "UXGEN-ES" project.
//	See copyright notice in "Engine.h".
//-------------------------------------------------------------------

#pragma once

#include "Base/Include/Common.h"

namespace Engine
{
namespace Base
{
	
	//
	// Sensor Type
	//

	struct ESensor
	{
		enum type
		{
			NONE = 0,
			ACCELEROMETER,
			MAGNETIC_FIELD,
			GYROSCOPE,
			ROTATION,
			ORIENTATION,
			LIGHT,
			PROXIMITY,
			LOCATION,
			_COUNT
		};
	};



	//
	// Directory Type
	//

	struct EDirectory
	{
		enum type
		{
			INTERNAL		= 0,		//	data/data/<package>/files
			INTERNAL_CACHE,				//	data/data/<package>/cache
			EXTERNAL,					//	/mnt/sdcard/data/Android/<package>/files
			EXTERNAL_CACHE,				//	/mnt/sdcard/data/Android/<package>/cache
			EXTERNAL_STORAGE,			//	/mnt/sdcard/
			_COUNT
		};

		inline static const char * Name (type t)
		{
			DEBUG_ONLY(
				static const char *	names[ _COUNT ] = {
					"internal",
					"internal_cache",
					"external",
					"external_cache",
					"external_storage"
				};
				return names[ t ];
			)
			RELEASE_ONLY(
				return "";
			)
		}
	};



	//
	// Display Orientation
	//

	struct EDisplayOrientation
	{
		enum type
		{
			DEFAULT				= -1,
			SENSOR				= -2,
			PORTRAIT			= 0,
			PORTRAIT_REVERSE	= 180,
			LANDSCAPE			= 90,
			LANDSCAPE_REVERSE	= 270,
		};

		inline static Display::EOrientation ToDisplayOrientation (type t)
		{
			switch ( t )
			{
				default :
				case PORTRAIT :			return Display::ORIENT_0;
				case LANDSCAPE :		return Display::ORIENT_90;
				case PORTRAIT_REVERSE :	return Display::ORIENT_180;
				case LANDSCAPE_REVERSE:	return Display::ORIENT_270;
			}
		}

		inline static type FromOrientation (Display::EOrientation t)
		{
			switch ( t )
			{
				default :
				case Display::ORIENT_0 :	return PORTRAIT;
				case Display::ORIENT_90 :	return LANDSCAPE;
				case Display::ORIENT_180 :	return PORTRAIT_REVERSE;
				case Display::ORIENT_270 :	return LANDSCAPE_REVERSE;
			}
		}
	};



	//
	// License Check Response
	//

	struct ELicenseCheckResponse
	{
		enum type
		{
			// license checking succeeded.
			LICENSED,

			// application not licensed.
			NOT_LICENSED,

			// retry license checking.
			RETRY,

			// when next call of IPlatform::CheckLicense override previous callback.
			DETACHED_LISTENER,

			// on error occured, "error" parameter in callback contains description.
			ERROR,

			// can't check license when internet is not connected
			NO_INTERNET_CONNECTION,
		};
	};


}	// Base
}	// Engine